﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace DispatchAssist.BusinessLogical.Model
{
    /// <summary>
    /// MsgTemplate
    /// </summary>
    public class MsgTemplate
    {

        /// <summary>
        /// MsgTemplate 构造函数
        /// </summary>
        public MsgTemplate()
        { }


        /// <summary>
        /// MsgTemplate OR映射构造函数
        /// </summary>
        public MsgTemplate(System.Data.IDataReader dr)
        {
            this.MsgTemplateID = (Guid)dr["MsgTemplateID"];
            this.AlertAction = Convert.ToInt32(dr["AlertAction"]);
            this.MsgContent = Convert.ToString(dr["MsgContent"]);
            this.TargetType = Convert.ToString(dr["TargetType"]);
            this.LastModifyTime = Convert.ToDateTime(dr["LastModifyTime"]);
            this.DeleteFlag = Convert.ToBoolean(dr["DeleteFlag"]);
        }


        /// <summary>
        /// 
        /// </summary>
        public Guid MsgTemplateID { get; set; }

        /// <summary>
        /// 告警行位位叠加
        /// </summary>
        public int AlertAction { get; set; }

        /// <summary>
        /// 告警信息模板内容
        /// </summary>
        public string MsgContent { get; set; }

        /// <summary>
        /// 目标（设备）型号/类型
        /// </summary>
        public string TargetType { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime LastModifyTime { get; set; }

        /// <summary>
        /// 逻辑删除标记
        /// </summary>
        public bool DeleteFlag { get; set; }

        public override string ToString()
        {
            return string.Format("[预警机场:{0},告警信息模板内容：{1}]", AlertAction, MsgContent);
        }

    }
}
